package com.sihan.framework.etm.dto;

import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author QinC
 * @create 2018-09-06 15:04
 */
@Data
public class SecurityParamUpdateDTO implements Serializable {

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@NotNull(message = "{id}")
    @Range(min = 1, max = 1, message = "{security.param.id}")
    private Integer id;
    /**
     * 口令期限
     */
    @Range(min = 1, max = 3, message = "{security.param.psd}")
    private Integer psd;

    /**
     * 会话过期时间
     */
    @Range(min = 1, max = 30, message = "{security.param.globalSessionTimeout}")
    private Integer globalSessionTimeout;

    /**
     * 最大并发会话数
     */
    @Range(min = 1, max = 10000, message = "{security.param.maxSession}")
    private Integer maxSession;

    /**
     * 登录失败次数
     */
    @Range(min = 1, max = 10, message = "{security.param.faultNum}")
    private Integer faultNum;

    /**
     * 锁定时间分钟
     */
    @Range(min = 20, max = 60, message = "{security.param.lockTime}")
    private Integer lockTime;

    /**
     * 账号扫描周期（月）
     */
    @Range(min = 1, max = 3, message = "{security.param.scanCycle}")
    private Integer scanCycle;

    /**
     * 审计日志存储空间的容量上限
     */
    @Range(min = 1, max = 10240, message = "{security.param.dataUp}")
    private Integer dataUp;

    /**
     * 临时账号有效期（月）
     */
    @Range(min = 1, max = 3, message = "{security.param.tempAccount}")
    private Integer tempAccount;

    /**
     * 休眠账号休眠期限（月）
     */
    @Range(min = 1, max = 12, message = "{security.param.sleepAccount}")
    private Integer sleepAccount;

    @Override
    public String toString() {
        return "安全参数id[" + id +
                "]、口令期限（月）[" + psd +
                "]、会话过期时间（分）[" + globalSessionTimeout +
                "]、最大并发会话数[" + maxSession +
                "]、登录失败次数[" + faultNum +
                "]、锁定时间（分）[" + lockTime +
                "]、账号扫描周期（月）[" + scanCycle +
                "]、审计日志存储空间的容量上限（GB）[" + dataUp +
                "]、临时账号有效期（月）[" + tempAccount +
                "]、休眠账号休眠期限（月）[" + sleepAccount +
                "]。";
    }
}
